<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../ajax.js"></script>
  </head>

  <body>
    <script>
      const url = "http://localhost:8000/calc/multiply";
      
      ajaxPromise({
        url,
        data: { a: 1, b: 2 },
      })
        .then((value) => ajaxPromise({ url, data: { a: value, b: 3 } }))
        .then((value) => ajaxPromise({ url, data: { a: value, b: 4 } }))
        .then((value) => ajaxPromise({ url, data: { a: value, b: 5 } }))
        .then((value) => console.log("最终结果", value))
        .catch((err) => console.error(err))
        .finally(() => console.log("game over"));

    </script>
  </body>
</html>
